0

Here you can read:

64-bit UID's are clever ways to identify a user, but suck when printed out. 18446744073709551616. 20 characters! Using base64 encoding, or even just hexadecimal, you can cut that down by quite a bit Blockquote

but as far I know 18446744073709551616 will result in a bigger string if is encoded using Base64. I know that I´m missing something, cos those memecached people are smart and in the doc they mentioned more than one time that using Base64 encoding could be useul to improve a key before store it into the memcahed. How is that?

4

2 回答 2

0

不要像字符串一样威胁 UID,而是使用 64 位数字表示。它恰好需要 64 位或 8 个字节。使用十六进制编码 8 个字节将产生类似“FF1122EE44556677”的字符串 - 16 个字节。使用 base64 编码,您将获得更短的字符串。

于 2014-06-04T13:00:09.157 回答
0

您所看到的基本上是 64 位的十进制表示。他们可能正在谈论将底层位直接编码为 Base64 或十六进制,而不是对位的十进制表示进行编码。他们基本上只是在谈论字母大小。字母表越大,字符串越短:

64 位作为位(2 的字母,01)是 64 个字符
64 位作为十进制(10 的字母,0- 9)是 20 个字符
64 位作为十六进制(16 的字母,0- F)是 16 个字符
等...

于 2014-06-04T13:00:43.367 回答