mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
react app
This commit is contained in:
27
react-app/node_modules/base62/base62.js
generated
vendored
Normal file
27
react-app/node_modules/base62/base62.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
var Base62 = (function (my) {
|
||||
my.chars = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
|
||||
|
||||
my.encode = function(i){
|
||||
if (i === 0) {return '0'}
|
||||
var s = ''
|
||||
while (i > 0) {
|
||||
s = this.chars[i % 62] + s
|
||||
i = Math.floor(i/62)
|
||||
}
|
||||
return s
|
||||
};
|
||||
my.decode = function(a,b,c,d){
|
||||
for (
|
||||
b = c = (
|
||||
a === (/\W|_|^$/.test(a += "") || a)
|
||||
) - 1;
|
||||
d = a.charCodeAt(c++);
|
||||
)
|
||||
b = b * 62 + d - [, 48, 29, 87][d >> 5];
|
||||
return b
|
||||
};
|
||||
|
||||
return my;
|
||||
}({}));
|
||||
|
||||
module.exports = Base62
|
Reference in New Issue
Block a user