1
0
Fork 0
forked from 0x2620/oxjs

change the signature of Ox.pad to match Ox.truncate

This commit is contained in:
rolux 2012-06-04 11:08:38 +02:00
commit a5c6747b57
10 changed files with 62 additions and 29 deletions

View file

@ -352,7 +352,7 @@ Ox.load.Image = function(options, callback) {
str = Ox[deflate ? 'encodeDeflate' : 'encodeUTF8'](str);
len = str.length;
// Prefix the string with its length, as a four-byte value
str = Ox.pad(Ox.encodeBase256(len), 4, '\u0000') + str;
str = Ox.pad(Ox.encodeBase256(len), 'left', 4, '\u0000') + str;
str.length > cap && error('encode');
while (str.length < cap) {
str += str.substr(4, len);