holixus / nano-md5 Goto Github PK
View Code? Open in Web Editor NEWmd5/md5crypt functions. UTF8 compatible. Small. Fast. 100% tests coverage. No dependencies.
License: MIT License
md5/md5crypt functions. UTF8 compatible. Small. Fast. 100% tests coverage. No dependencies.
License: MIT License
I see a couple of problems with this lib:
Math.random()
to generate salt values. Which is not a cryptographically secure method of generating randomness.Just a note for someone considering using this.
Hello, I'm unable to use crypt function with a string over 15 characters. Is there any known limitation about that? Any way to fix it?
See comparison with md5 and blueimp-md5 libraries https://runkit.com/pober/nano-md5-incorrect-hash/1.0.1 or do it by yourself:
const nanoMD5 = require("nano-md5");
const md5 = require("md5");
const blueimpMD5 = require("blueimp-md5");
function checkHashes(length) {
const inputString = new Array(length).fill('a').join('');
const outputStringNanoMD5 = nanoMD5(inputString);
const outputStringMD5 = md5(inputString);
const outputStringBlueimpMD5 = blueimpMD5(inputString);
if (outputStringNanoMD5 !== outputStringMD5 || outputStringNanoMD5 !== outputStringBlueimpMD5) {
console.log(`String length: ${inputString.length}, nano-md5: ${nanoMD5(inputString)}, md5: ${outputStringMD5}, blueimp-md5: ${blueimpMD5(inputString)}`);
}
}
for (let i = 1; i < 1000; i++) {
checkHashes(i);
}
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.