javascript - Encryption Function returning Set Length -
i attempting write encryption function (writing in javascript easier testing) though have bit of issue.
larger, more popular encryption methods such md5, sha1, etc. have fixed length. how done exactly? example, "0"
, "0123456789"
encrypted same length.
this function @ moment:
string.prototype.encrypt = function() { var l = this.length, = [], s = this.split(''); s.foreach(function(v) { a.push(v.charcodeat() << l); }); s.foreach(function(v,i) { s[i] = (v.charcodeat() << a[i]) << l; }); homecoming s.join(''); };
what can have homecoming string of set length?
p.s: know isn't secure, i'm still working on that.
javascript encryption
No comments:
Post a Comment