salt - javascript behavior for '\352' decimal value -


while checking login page, found following js code

hexmd5('\232' + document.login.password.value + '\305\334\122\134\352'); 

so, asking \352 occupy 1 byte , hence cause overflow , yield 96 or java script interpreter promote short preserve value?

javascript doesn't have bytes, shorts, or integers*, has number type, double-precision ieee-754 number. that's not relevant code you've shown unless uses charcodeat on string corresponding code point 1 of characters in it, because you're defining code points (loosely, "characters") in string, not numbers. characters in javascript 16-bit entities, octal escape '\352' encodes character 234 decimal, readily fits within character's 16-bit range.

side note: octal escapes not part of main standard , disallowed in strict mode. they're part of non-normative annex specification. i'd recommend using hex escapes or unicode escapes rather octal ones.

* well, javascript have 32-bit integers transient thing during bit-related calculations, such performed & , | operators.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -