Jump to content




SHA-256 API?


9 replies to this topic

#1 !!!!!!!!!!ExclaimationMark

  • Members
  • 30 posts

Posted 10 August 2014 - 07:37 AM

I've heard of an SHA256 API floating around here. where is it?

#2 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 10 August 2014 - 08:21 AM

The forum search is an amazing thing.

Edited by theoriginalbit, 10 August 2014 - 12:25 PM.
copied the wrong link


#3 !!!!!!!!!!ExclaimationMark

  • Members
  • 30 posts

Posted 10 August 2014 - 12:29 PM

I saw that. still confused.

#4 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 10 August 2014 - 01:22 PM

So if you saw it, why did you ask where the API was? :huh:

What is confusing about it?

#5 TheOddByte

    Lazy Coder

  • Members
  • 1,607 posts
  • LocationSweden

Posted 10 August 2014 - 02:55 PM

If you looked through the code you would have found a function called sha256 at the bottom, it's easy to use
local text    = "Hello"
local hash  = sha256( text )

Now if you want to use this as an API you would have to remove the local before the function so it can be used
Like this
Now load it as you usually do with APIs
os.loadAPI( "hash" ) -- we're going to call the file hash here, change it to whatever you named it
print( hash.sha256( "Hello" ) )


#6 !!!!!!!!!!ExclaimationMark

  • Members
  • 30 posts

Posted 11 August 2014 - 12:15 AM

Oic

#7 !!!!!!!!!!ExclaimationMark

  • Members
  • 30 posts

Posted 11 August 2014 - 12:17 AM

Oh, and BTW, will it work on other Luas (e.g. OC Lua(5.2), Roblox Lua (5.1))

#8 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 11 August 2014 - 01:17 AM

its a completely contained API, requiring nothing external, so yes, it should work. However the way you load it will differ.

#9 !!!!!!!!!!ExclaimationMark

  • Members
  • 30 posts

Posted 11 August 2014 - 05:40 AM

View Posttheoriginalbit, on 11 August 2014 - 01:17 AM, said:

its a completely contained API, requiring nothing external, so yes, it should work. However the way you load it will differ.
According to the thread it's supposed to be in the program, so... no need to load

#10 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 11 August 2014 - 05:48 AM

it can be external it doesn't have to be defined in the program.

Edited by theoriginalbit, 11 August 2014 - 05:48 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users