Questions tagged [base62]

Base62 is a positional notation compression notably used (optionally) by Dean Edwards' packer JavaScript compressor.

Base62 is a positional notation compression notably used (optionally) by Dean Edwards' packer JavaScript compressor. Edwards points out that using the Base62 feature of packer is only necessary if you cannot for some reason use gzip compression.

33 questions
108
votes
23 answers

Base 62 conversion

How would you convert an integer to base 62 (like hexadecimal, but with these digits: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'). I have been trying to find a good Python library for it, but they all seems to be occupied with…
mikl
  • 23,749
  • 20
  • 68
  • 89
37
votes
8 answers

Creating a salt in python

How would I create a random, 16-character base-62 salt in python? I need it for a protocol and I'm not sure where to start. Thanks.
pajm
  • 1,788
  • 6
  • 24
  • 30
12
votes
9 answers

Convert MD5 to base62 for URL

I have a script to convert to base 62 (A-Za-z0-9) but how do I get a number out of MD5? I have read in many places that because the number from an MD5 is bigger than php can handle as an integer it will be inaccurate... As I want a short URL anyway…
Mark
  • 5,423
  • 11
  • 47
  • 62
11
votes
3 answers

Is there anything wrong with using base62 (Alphanumeric) UUIDs?

Standard UUIDs are long, and you can't select the whole thing by double clicking. e.g. 123e4567-e89b-12d3-a456-426655440000 I like shorter IDs. I like being able to double click an ID to select it. My question is: are there any issues with…
JeremyTM
  • 593
  • 6
  • 17
10
votes
6 answers

PHP - How to base_convert() up to base 62

I need a base_convert() function that works from base 2 up to base 62 but I'm missing the math I need to use, I know that due to the limitations of PHP I need to make use of bcmath, which is fine. Functions like these convert a number to and from…
Alix Axel
  • 151,645
  • 95
  • 393
  • 500
9
votes
3 answers

Shortening java UUID while preserving the uniqueness

I'm trying to make the java UUID shorter while preserving the same uniqueness as the UUID has. I wrote the following code: public static void main(String[] args) { UUID uid=UUID.randomUUID(); String…
Fipil
  • 291
  • 2
  • 5
  • 16
6
votes
2 answers

Encoding UUID to Base62 (not Base64) in Java

I'm trying to shorten UUID values (stored in DB as UUID, not string) to be embedded in URLs. I'm aware of Base64 for URL, but trying to see if I can make it without dash and underscore characters. So I would like to convert UUID to base62. After a…
Rad
  • 4,292
  • 8
  • 33
  • 71
6
votes
3 answers

Convert a string into BASE62

I'm looking for the c# code to convert a string into BASE62, like this: http://www.molengo.com/base62/title/base62-encoder-decoder I need those encode and decode-methods for URL-Encoding.
fubo
  • 44,811
  • 17
  • 103
  • 137
4
votes
5 answers

How to generate base62 UUIDs in node.js?

I'm looking for a solution to generate base62 UUIDs in node.js. I'd like to avoid base64 as I intend to create folders based on these UUIDs and characters like =, \, -, _ (as in some implementations) are not that human/filesystem friendly. Base62…
Dário
  • 2,002
  • 1
  • 18
  • 28
3
votes
4 answers

Will this obfuscation algorithm for a URL shortener work?

DISCLAIMER: I am not asking how to make a URL shortener (I have already implemented the "bijective function" answer found HERE that uses a base-62 encoded string). Instead, I want to expand this implementation to obfuscate the generated string so…
dooleyo
  • 872
  • 1
  • 9
  • 13
3
votes
3 answers

convert base64 to base62 (without special characters)

I want to pass a blowfish encrypted string in a URL, and want to encode it like base64, but without any special character, something like base62 would be great (0-9a-zA-Z). So what I'm trying to do is converting the blowfish encrypted string using…
ak2
  • 457
  • 1
  • 5
  • 17
2
votes
1 answer

Is there the way to encode base62 string in Angular 7?

I'm trying to find the way to encode some of data the need to send back to the API. I've tried Base-x library but it didn't work. Is there any other way to do this without programmatically without any library?
Max Kasem
  • 79
  • 9
2
votes
3 answers

Print first N numbers in BASE62

I would like to print first N numbers in BASE62 encoding. What's wrong in my code? const char ALPHABET[63] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; int main(void) { int N = 50; for (int i = 0; i < N; i++) { …
Bakus123
  • 1,399
  • 6
  • 21
  • 40
1
vote
2 answers

Are there multiple Base62 Encoding Algorithm?

I was watching a tutorial regarding system design for tiny url, and reading up on base62 encoding to avoid collision. They say to use a counter, and encode it with base62. Now this makes sense but looking at some online base62encoder, if the tiny…
Harts
  • 4,023
  • 9
  • 54
  • 93
1
vote
4 answers

Please explain this base 62 PHP conversion function/algorithm

Could anyone please explain the code below? That or point me to some resources shedding some light :) It converts an integer to a base62 string. private static $_characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; private…
Markus Hedlund
  • 23,374
  • 22
  • 80
  • 109
1
2 3