Telegram Group & Telegram Channel
Оптимизируем кодирование u128 в base62

В процессе работы над своим приложением для заметок, когда я дошел до сохранения данных в базу данных я стал использовать для идентификации записей uuid4 идентификаторы, которые обычно выглядят примерно так, когда представлены в виде строки:
32dca18531a1435480461f99837a5b1d

По некоторым причинам использовать uuid мне не очень нравилось:
это довольно длинная строка из 32 символов, а мне надо будет иногда показывать ее пользователям
6 бит в uuid4 не используются, это константы, расточительно

константные биты в uuid4:
uuid.uuid4().bytes[6] & 0b11110000 # == 64
uuid.uuid4().bytes[8] & 0b11000000 # == 128


https://habr.com/ru/articles/739936/

👉 @rust_lib



tg-me.com/rust_lib/142
Create:
Last Update:

Оптимизируем кодирование u128 в base62

В процессе работы над своим приложением для заметок, когда я дошел до сохранения данных в базу данных я стал использовать для идентификации записей uuid4 идентификаторы, которые обычно выглядят примерно так, когда представлены в виде строки:
32dca18531a1435480461f99837a5b1d

По некоторым причинам использовать uuid мне не очень нравилось:
это довольно длинная строка из 32 символов, а мне надо будет иногда показывать ее пользователям
6 бит в uuid4 не используются, это константы, расточительно

константные биты в uuid4:
uuid.uuid4().bytes[6] & 0b11110000 # == 64
uuid.uuid4().bytes[8] & 0b11000000 # == 128


https://habr.com/ru/articles/739936/

👉 @rust_lib

BY Rust




Share with your friend now:
tg-me.com/rust_lib/142

View MORE
Open in Telegram


Rust Telegram | DID YOU KNOW?

Date: |

The Singapore stock market has alternated between positive and negative finishes through the last five trading days since the end of the two-day winning streak in which it had added more than a dozen points or 0.4 percent. The Straits Times Index now sits just above the 3,060-point plateau and it's likely to see a narrow trading range on Monday.

Telegram Gives Up On Crypto Blockchain Project

Durov said on his Telegram channel today that the two and a half year blockchain and crypto project has been put to sleep. Ironically, after leaving Russia because the government wanted his encryption keys to his social media firm, Durov’s cryptocurrency idea lost steam because of a U.S. court. “The technology we created allowed for an open, free, decentralized exchange of value and ideas. TON had the potential to revolutionize how people store and transfer funds and information,” he wrote on his channel. “Unfortunately, a U.S. court stopped TON from happening.”

Rust from us


Telegram Rust
FROM USA