danielgtaylor / danielgtaylor/guid-tool-web
Byte ordering for Base64?
- Dominant language
- Python
- Stars
- 18
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I also had to implement UUID conversion to Base64 (in java) and wanted to cross-check/validate my implementation with yours... and it gave different results.
Take the following UUID: `56d352bc-dd5a-4480-bc39-cc297ef49faf`
My result in B64 is `VtNSvN1aRIC8OcwpfvSfrw`
B64: V-----t-----N-----S-----v-----N-----1-----a-----R-----I-----C-----8-----O-----c-----w-----p-----f-----v-----S-----f-----r-----w-----
BIN: 01010110110100110101001010111100110111010101101001000100100000001011110000111001110011000010100101111110111101001001111110101111
HEX: 5---6---d---3---5---2---b---c---d---d---5---a---4---4---8---0---b---c---3---9---c---c---2---9---7---e---f---4---9---f---a---f---
While your result in B64 is `vFLTVlrdgES8OcwpfvSfrw` (without padding)
B64: v-----F-----L-----T-----V-----l-----r-----d-----g-----E-----S-----8-----O-----c-----w-----p-----f-----v-----S-----f-----r-----w-----
BIN: 10111100010100101101001101010110010110101101110110000000010001001011110000111001110011000010100101111110111101001001111110101111
HEX: b---c---5---2---d---3---5---6---5---a---d---d---8---0---4---4---b---c---3---9---c---c---2---9---7---e---f---4---9---f---a---f---
`bc52d356-5add-8044-bc39-cc297ef49faf` <> `56d352bc-dd5a-4480-bc39-cc297ef49faf`
Is there a reason why your first 3 groups (`56d352bc-dd5a-4480`) have a different byte order than the 2 last ones (`bc39-cc297ef49faf`)? Did you do that on purpose (and so why) or is it a bug?
Regards
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.