andreystepanov / hashids.sql Goto Github PK
View Code? Open in Web Editor NEWPL/pgSQL implementation of hashids library
Home Page: https://hashids.org/
License: MIT License
PL/pgSQL implementation of hashids library
Home Page: https://hashids.org/
License: MIT License
The implementation of the hashids.to_alphabet
function leads to different encodings for the value 0 compared to implementations in other languages. Specifically, if current_number
begins as 0 the function is essentially skipped.
Line 13 in 3464d83
Thank you for getting this off the ground! In doing some playing around I noticed that I got different results when I used a custom alphabet using your library than through the Javascript or Ruby versions.
I used this codepen from Ivan Akimov to test the JS version:
https://codepen.io/ivanakimov/pen/bNmExm
ID: 1 / salt: 'salt' / no custom alphabet - OK
Javascript: XG
Ruby: XG
PL/SQL: XG
ID: 1 / min_length: 6 / salt: 'salt' / no custom alphabet - OK
Javascript: xkXG8Z
Ruby: xkXG8Z
PL/SQL: xkXG8Z
ID: 1 / min_length: 6 / salt: 'salt' / alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' - ERROR
Javascript: MEPWMP
Ruby: MEPWMP
PL/SQL: JPRAPM
I wish I could offer more assistance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.