This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!String.prototype.toNumberString) { | |
/** | |
* Converts each character into its numerical representation of given base | |
* By default converts to Hexadecimal (base = 16) | |
* This conversion is required for JWT implementation http://kjur.github.io/jsrsasign/ | |
* | |
* Examples: | |
* '*123'.toNumberString(); //returns '2a313233' | |
* '*123'.toNumberString(10); //returns '42495051' | |
* '*123'.toNumberString(8); //returns '52616263'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* MD5 by: http://www.myersdaily.org/joseph/javascript/md5-text.html | |
* Polyfill by: https://gist.github.com/nothrem/f1aad311019009a9252592716b368b53 | |
*/ | |
if (!String.prototype.md5) { | |
(function () { | |
var md5cycle = function(x, k) { | |
var a = x[0], b = x[1], c = x[2], d = x[3]; | |
a = ff(a, b, c, d, k[0], 7, -680876936); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Use as standalone function or static method of any object. | |
* Set default $shardLevel to a value relevant for your usercase (e.g. +3 for MD5 filenames, -2 for ID filenames, etc.) | |
*/ | |
/** | |
* Creates subfolders for storing files to prevent folder overloading by too many files. | |
* | |
* @param mixed $filename (required) Basic filename without extension. Can be anything convertable to string valid for filenaming. | |
* @param string $root (optional, default: '/') Where to start creating the subfolders. Set false to skip folder creation. | |
* @param string $ext (optional, default: none) Extension for the file. |