ran npm run tdd & generated TDD
This commit is contained in:
8
test/sdbm/sdbm.js
Normal file
8
test/sdbm/sdbm.js
Normal file
@ -0,0 +1,8 @@
|
||||
module.exports = str => {
|
||||
let arr = str.split('');
|
||||
return arr.reduce(
|
||||
(hashCode, currentVal) =>
|
||||
(hashCode = currentVal.charCodeAt(0) + (hashCode << 6) + (hashCode << 16) - hashCode),
|
||||
0
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user