Jump to content




KillaVanilla's Various APIs


24 replies to this topic

#21 KillaVanilla

  • Members
  • 303 posts

Posted 12 March 2014 - 04:39 PM

View PostAnavrins, on 12 March 2014 - 12:56 PM, said:

View PostKillaVanilla, on 12 March 2014 - 08:45 AM, said:

...Are you using the latest version of the AES API?
The issue appears to be fixed in the version on Pastebin.

Assuming you mean this pastebin: http://pastebin.com/rCYDnCxn
Then no, it still occurs for me somehow, and it still is that undefined "incAmt" variable in the increment_ctr() function.
Oh, whoops. Forgot about that.
I'll get to fixing it.

#22 lebalusch

  • Members
  • 49 posts

Posted 29 June 2014 - 05:33 PM

So How do I get rid of the table stuff at the end of my SHA256 output?
How comes the table bit changes all the time even though its the same script run?

Spoiler

edit:
solved I belive. If you see a mistake in how i have achived this please tell me guys.
os.loadAPI("sha256")
password = "This is my password123456"
text =sha256.digestStr(password)
print(text)

Edited by lebalusch, 29 June 2014 - 10:04 PM.


#23 Rougeminner

  • Members
  • 151 posts

Posted 01 December 2014 - 06:00 AM

why does my script receive a java exception thrown error when i use xxx = "testing" base64.encode(xxx)

i tried moving th quotes but that just gives a table after decode

#24 Anavrins

  • Members
  • 775 posts

Posted 10 December 2014 - 03:34 PM

View PostRougeminner, on 01 December 2014 - 06:00 AM, said:

why does my script receive a java exception thrown error when i use xxx = "testing" base64.encode(xxx)
i tried moving th quotes but that just gives a table after decode
That's the expected behavior, since base64 is used to encode binary into text, and once decoded you can't store binary into a string.
Each keys in the table contains the string.byte() of each characters, so "hello" would be {104, 101, 108, 108, 111}
You can turn it back into a string with this function
local function byteToString(bytes)
  return (("%c"):rep(#bytes)):format(unpack(bytes))
end

Edited by Anavrins, 10 December 2014 - 03:40 PM.


#25 AgentE382

  • Members
  • 119 posts

Posted 11 December 2014 - 04:07 AM

Um... you could also use this much simpler (and faster) way:
string.char(unpack(bytes))

Edited by AgentE382, 11 December 2014 - 04:08 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users