- Joined
- Jul 10, 2007
- Messages
- 6,306
althouh IDK what's the purpose of this, but can you just merge all your submissions related to this one in this thread and put it in a test map (it's already required in submitting a resource)...
put it in a test map (it's already required in submitting a resource)
no, I mean like this in this thread only:Are you kidding me with merging them all into one resource?
struct Testing extends array
private static hashtable hex = InitHashtable()
private static method toBitStr takes string str returns string
local string s = ""
local integer i = StringLength(str)
loop
set s = LoadStr(hex, StringHash(SubString(str, i - 1, i)), 0) + s
exitwhen 0 == i
set i = i - 1
endloop
return s
endmethod
private static method init takes nothing returns nothing
local BitInt i = BitInt.create()
local BitInt cipherI = BitInt.convertString(toBitStr("2b28ab097eaef7cf15d2154f16a6883c"), 4)
local AES_Data cipher = AES_Data.create()
local AES_Data data = AES_Data.create()
local AES aes
local BitInt dataI
call i.write(1, 1)
call i.write(-343, 32)
call i.write(1, 1)
call i.write(14, 11)
call i.write(19, 9)
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60000,i.toString())
call cipher.load(cipherI, 0)
call cipherI.destroy()
set aes = AES.create(cipher)
call data.load(i, 0)
call aes.encrypt(data)
set dataI = data.toBitInt()
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60000,dataI.toString())
call aes.decrypt(data)
call dataI.destroy()
set dataI = data.toBitInt()
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60000,dataI.toString())
call dataI.destroy()
call i.destroy()
endmethod
private static method onInit takes nothing returns nothing
call SaveStr(hex, StringHash("0"), 0, BitInt.charTable[0])
call SaveStr(hex, StringHash("1"), 0, BitInt.charTable[1])
call SaveStr(hex, StringHash("2"), 0, BitInt.charTable[2])
call SaveStr(hex, StringHash("3"), 0, BitInt.charTable[3])
call SaveStr(hex, StringHash("4"), 0, BitInt.charTable[4])
call SaveStr(hex, StringHash("5"), 0, BitInt.charTable[5])
call SaveStr(hex, StringHash("6"), 0, BitInt.charTable[6])
call SaveStr(hex, StringHash("7"), 0, BitInt.charTable[7])
call SaveStr(hex, StringHash("8"), 0, BitInt.charTable[8])
call SaveStr(hex, StringHash("9"), 0, BitInt.charTable[9])
call SaveStr(hex, StringHash("a"), 0, BitInt.charTable[10])
call SaveStr(hex, StringHash("b"), 0, BitInt.charTable[11])
call SaveStr(hex, StringHash("c"), 0, BitInt.charTable[12])
call SaveStr(hex, StringHash("d"), 0, BitInt.charTable[13])
call SaveStr(hex, StringHash("e"), 0, BitInt.charTable[14])
call SaveStr(hex, StringHash("f"), 0, BitInt.charTable[15])
call TimerStart(CreateTimer(),0,false,function thistype.init)
endmethod
endstruct
struct Testing extends array
private static hashtable hex = InitHashtable()
private static method toBitStr takes string str returns string
local string s = ""
local integer i = StringLength(str)
loop
set s = LoadStr(hex, StringHash(SubString(str, i - 1, i)), 0) + s
exitwhen 0 == i
set i = i - 1
endloop
return s
endmethod
private static method init takes nothing returns nothing
local BitInt i = BitInt.create()
local BitInt cipherI = BitInt.convertString(toBitStr("2b28ab097eaef7cf15d2154f16a6883c"), 4)
local AES_Data cipher = AES_Data.create()
local AES_Data data = AES_Data.create()
local AES aes
call i.write(1, 1)
call i.write(-343, 32)
call i.write(1, 1)
call i.write(14, 11)
call i.write(19, 9)
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60000,i.toString())
call cipher.load(cipherI, 0)
call cipherI.destroy()
set aes = AES.create(cipher)
call data.load(i, 0)
call aes.encrypt(data)
call data.unload(i, 0)
call data.load(i, 5)
call aes.encrypt(data)
call data.unload(i, 5)
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60000,i.toString())
call aes.decrypt(data)
call data.unload(i, 5)
call data.load(i, 0)
call aes.decrypt(data)
call data.unload(i, 0)
call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,60000,i.toString())
call i.destroy()
endmethod
private static method onInit takes nothing returns nothing
call SaveStr(hex, StringHash("0"), 0, BitInt.charTable[0])
call SaveStr(hex, StringHash("1"), 0, BitInt.charTable[1])
call SaveStr(hex, StringHash("2"), 0, BitInt.charTable[2])
call SaveStr(hex, StringHash("3"), 0, BitInt.charTable[3])
call SaveStr(hex, StringHash("4"), 0, BitInt.charTable[4])
call SaveStr(hex, StringHash("5"), 0, BitInt.charTable[5])
call SaveStr(hex, StringHash("6"), 0, BitInt.charTable[6])
call SaveStr(hex, StringHash("7"), 0, BitInt.charTable[7])
call SaveStr(hex, StringHash("8"), 0, BitInt.charTable[8])
call SaveStr(hex, StringHash("9"), 0, BitInt.charTable[9])
call SaveStr(hex, StringHash("a"), 0, BitInt.charTable[10])
call SaveStr(hex, StringHash("b"), 0, BitInt.charTable[11])
call SaveStr(hex, StringHash("c"), 0, BitInt.charTable[12])
call SaveStr(hex, StringHash("d"), 0, BitInt.charTable[13])
call SaveStr(hex, StringHash("e"), 0, BitInt.charTable[14])
call SaveStr(hex, StringHash("f"), 0, BitInt.charTable[15])
call TimerStart(CreateTimer(),0,false,function thistype.init)
endmethod
endstruct