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
1
vote
1 answer

Obfuscating ids in Rails app

I'm trying to obfuscate all the ids that leave the server, i.e., ids appearing in URLs and in the HTML output. I've written a simple Base62 lib that has the methods encode and decode. Defining—or better—overwriting the id method of an ActiveRecord…
fphilipe
  • 9,739
  • 1
  • 40
  • 52
1
vote
1 answer

How can i generate Salesforce case Id's? decode/encode base62 base64

I need to be able to generate salesforce object (cases) Id's, so i can create links for my robot assistant :-). I believe you can use the API , but this option is out of reach for me :-( So, Reading about salesforce objects, it seems to be of the…
The Unix Janitor
  • 558
  • 1
  • 6
  • 15
1
vote
1 answer

Multi-base conversion - using all combinations for URL shortener

I am making an URL shortener, and I am struggling with the optimal way of encoding a number (id) into a character string. I am using the characters 0-9,A-Z,a-z so it will basically be a base-62 encoding. That is pretty basic, but it doesn't make use…
Guffa
  • 687,336
  • 108
  • 737
  • 1,005
1
vote
1 answer

JavaScript base62 encode performance implications

Encoding JavaScript files with base62 diminishes its file size but reduces performance. But how, exactly? Once the JavaScript file is loaded, does the JavaScript engine have to unencode the file only once or does it have to unencode it in real…
André Casal
  • 1,012
  • 1
  • 11
  • 25
1
vote
2 answers

How difficult/easy is it to decode a custom base 62 encoding?

Here's what I am going to do to obfuscate database id's in permalinks: 1) XOR the id with a lengthy secret key 2) Scramble (rotate, flip, reverse) bits around a little in the XOR'ed integer in a reversible way 3) Base 62 encode the resulting…
Optimus
  • 2,716
  • 4
  • 29
  • 49
0
votes
1 answer

Auto-generate Base62 numbers without vowels (PHP)?

This may end up being a trivial question - I know I'm going to need to do this soon for an app I'm working on, but haven't really worked on it myself yet - I'm really just floating it to see if there's an obvious method I'm missing. Basically, what…
Eli
  • 97,462
  • 20
  • 76
  • 81
0
votes
0 answers

Instagram Email Login Token

I was looking at Instagram’s email login url, and found 2 variables. uid and token. I found out that uid is the userid encoded to base36. Also there is a token which is 5-6 characters long. Also found out that this token changes every 24 hours, so…
Uygi
  • 1
  • 1
0
votes
3 answers

How to do an Encode/Decode function in Base62 with no obvious pattern in the Results?

I have a site where users must confirm their e-mail using a typical e-mail confirmation script with a specific (but long) Confirmation Link for each user that includes the usual hash parameter. The problem I'm having is that some users are having…
ProgrammerGirl
  • 3,157
  • 7
  • 45
  • 82
0
votes
0 answers

Converting base10 to base62 and back in PHP on a 32bit system

I found a previously asked question here, and am trying to implement Eineki's solution, however I'm on a 32bit system (I've installed Ubuntu 20.04 on an old laptop for testing). It was noted in the comments that the code wouldn't work on a 32bit…
0
votes
0 answers

Base62 Encoding Collision?

I have a very simple question, I have searched it in the internet everywhere and could not find the answer. It is possible for Base62 encoding to generate same string output for different number inputs? Example: base62(num1) -> str1 base62(num2) ->…
ndogac
  • 1,185
  • 6
  • 15
0
votes
1 answer

How to know that how much shorturl hashes could be generated?

How can I know that how much shorturl hashes could be generated by my little app in base62? So, if I write like this; $len = 4; $url = "http://stackoverflow.com/"; // base62 $chrs =…
Kerem
  • 11,377
  • 5
  • 59
  • 58
0
votes
2 answers

Tiny URL system design

I have read and watched many youtube videos & links which all provide same solution which is: Use a distributed counter like zookeeper Counter max limit can be 3.5 trillion Convert the Counter value to Base62 which is all fine when the counter…
Navin
  • 684
  • 1
  • 11
  • 24
0
votes
1 answer

How to fix the code for base62 encoding with Python3?

I am creating a python script for base62 encoding. However, for some reason, my code doesn't produce the correct answer. Correct answer is LpuPe81bc2w, but i get LpuPe81bc0w. If you can review my code and see if I can do any different. Please let me…
lolo
  • 25
  • 4
0
votes
3 answers

convert md5 string to base 62 string in c++

i'm trying to convert an md5 string (base 16) to a base 62 string in c++. every solution i've found so far for converting to base 62 only works if you can represent your number as a 64 bit integer or smaller. an md5 string is 128 bits and i'm not…
rev
  • 1,681
  • 2
  • 13
  • 21
0
votes
4 answers

jQuery having trouble selecting things in different cases

Note: If you're 'just' a jQuery developer some things in this post may look a tad complex (Base62 encoding etc.) - it's really not. Although the more technical details are relevant to the question, the core is that jQuery won't select stuff with…
Jack
  • 9,615
  • 18
  • 72
  • 112