Questions tagged [base32]

Base32 is a notation for encoding arbitrary byte data using a restricted set of symbols which can be conveniently used by humans and processed by old computer systems which only recognize restricted character sets.

Base32 is a notation for encoding arbitrary byte data using a restricted set of symbols which can be conveniently used by humans and processed by old computer systems which only recognize restricted character sets.

It comprises a symbol set made up of 32 different characters, as well as an algorithm for encoding arbitrary strings using 8-bit characters into the Base32 alphabet. This uses more than one 5-bit Base32 symbol for each 8-bit input character, and thus also specifies requirements on the allowed lengths of Base32 strings (which must be multiples of 40 bits).

The Base64 system, in contrast, is closely related but uses a larger set of 64 symbols.

See also

87 questions
45
votes
7 answers

Base32 Decoding

I have a base32 string which I need to convert to a byte array. And I'm having trouble finding a conversion method in the .NET framework. I can find methods for base64 but not for base32. Convert.FromBase64String – something like this for base32…
trampster
  • 8,598
  • 4
  • 37
  • 52
45
votes
6 answers

Why is a SHA-1 Hash 40 characters long if it is only 160 bit?

The title of the question says it all. I have been researching SHA-1 and most places I see it being 40 Hex Characters long which to me is 640bit. Could it not be represented just as well with only 10 hex characters 160bit = 20byte. And one hex…
AGrunewald
  • 1,735
  • 3
  • 16
  • 25
45
votes
3 answers

Random numbers don't seem very random

I am trying to generate random base32 numbers that are 6 characters or less. This should give approximately 1 billion different combinations. I have created a program to generate these “random” numbers. However, it appears that it generates a…
jkruer01
  • 2,175
  • 4
  • 32
  • 57
26
votes
10 answers

Fast open source checksum for small strings

I need a quick checksum (as fast as possilbe) for small strings (20-500 chars). I need the source code and that must be small! (about 100 LOC max) If it could generate strings in Base32/64. (or something similar) it would be perfect. Basically the…
Robin Rodricks
  • 110,798
  • 141
  • 398
  • 607
19
votes
2 answers

Encode string to base32 string in Java

Just like the title says, I am trying to encode a string "test" into base32 string "ORSXG5A=" in Java. All I find when searching online is classes that encodes from string to array with 32bits, but obviously that is not what I want. Sorry for this…
Daniele Testa
  • 1,538
  • 3
  • 16
  • 34
16
votes
3 answers

What is base32 encoding?

There is enough information on how to implement base32 encoding or the specification of base32 encoding but I don't understand what it is, why we need it and where are the primary applications. Can someone please explain and give nice real life…
Jeff
  • 13,079
  • 23
  • 71
  • 102
13
votes
2 answers

TOTP Base32 vs Base64

Every TOTP implementation (even FreeOTP by RedHat) I find uses Base32 encoding/decoding for its generated secret. Why is Base64 not used, since Base32 uses roughly 20 % more space and its main advantage is, that it is more human-readable? It is not…
Leth
  • 133
  • 1
  • 5
12
votes
5 answers

Encoding a number, C# implementation of z-base-32 or something else?

I need to encode/decode an integer which is up to 9 digits long but most often 7 digits long. I'd like to make it easier to communicate/memorise - it will be communicated by phone, copied & pasted, keyed in from a card/memory/label, hand-written on…
Robin Minto
  • 15,027
  • 4
  • 37
  • 40
4
votes
1 answer

Java implementation of Crockford's Base32 encoding/decoding

I'm looking for an implementation of Crockford's Base32 encoding/decoding in Java. Specifically, that means a Java library that I can use in my projects. Alternatively, some code example to do the encoding and decoding.
kongo09
  • 1,281
  • 10
  • 23
4
votes
1 answer

How to do Base32 encoding in python3?

Base32 encoding in python 2.7 works like this: $ python Python 2.7.10 (default, Oct 6 2017, 22:29:07) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>>…
Saqib Ali
  • 11,931
  • 41
  • 133
  • 272
4
votes
1 answer

Implementing the Crockford Base32 encoding in PHP

I'm trying to encode a string using the Crockford Base32 Algorithm. Unfortunately, my current code only accepts numeric values as input. I thought of converting the ASCII characters to Decimal or Octal, but then the concatenation of 010 and 100…
Stefan
  • 2,164
  • 1
  • 23
  • 40
3
votes
4 answers

Python: Integer to Base 32 hex (aka. Triacontakaidecimal)

Ok so going from Base 32 hex (aka. Triacontakaidecimal) to integer is pretty easy for example: >>>int("v", 32) 31 How do you do it the other way around however? I was thinking of setting up a dictionary if a method doesn't exist to do so. EDIT: I…
PDStat
  • 5,513
  • 10
  • 51
  • 86
3
votes
1 answer

how to convert a number to base32 in java as per RFC-4648

Actually I'm trying to use TOTP in my app and google authenticator requires the key to be in base32 format. This is the reason I'm trying to convert a key to base32 format Let's say I have a number = 150820200825235. This wikipedia page says that…
Nitin Verma
  • 485
  • 4
  • 19
3
votes
3 answers

Ignore a padding exception when base32 decoding using b32decode from base64 lib

I need a way to ignore the 'incorrect padding' exception when trying to decode a base32 string using base64 lib. I have seen this post Python: Ignore 'Incorrect padding' error when base64 decoding which resolves the problem for base64 (b64decode)…
Carlos Mediavilla
  • 184
  • 1
  • 1
  • 14
3
votes
1 answer

Can I alpha sort base32/64 encoded MD5 hashes?

I've got a massive file of hex encoded MD5 values that I'm using linux 'sort' utility to sort. The result is that the hashes come out in sequential order (which is what I need for the next stage of processing). E.g: 000001C35AE83CEFE245D255FFC4CE11…
Mark Thomson
  • 739
  • 5
  • 12
1
2 3 4 5 6