Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
hugetv
Level 7

Helps to create code

Help to create code for use in the same brs

    $mysecretkey = "mysecretkey";
    $expiry = strtotime("+1 hour");
    $b64 = base64_encode(md5($mysecretkey.$expiry,true));
    $b64u = rtrim(str_replace(array('+','/'),array('-','_'),$b64),'=');
    echo "http://sample.com/$path?e=$expiry&st=$b64u\n";
Our system http://www.rokumanager.com
0 Kudos
2 Replies
hugetv
Level 7

Re: Helps to create code

I'm trying with this but I have no result

dateNow=CreateObject("roDateTime")
dateNow=dateNow.asSeconds()+200

ba1 = CreateObject("roByteArray")
ba1.FromAsciiString("claveprivada"+dateNow)
digest = CreateObject("roEVPDigest")
digest.Setup("md5")
digest.Update(ba1)
hash = digest.Final()
print "Hash => "; hash

ba2 = CreateObject("roByteArray") 
ba2.FromAsciiString(hash)
usableHash = ba2.ToBase64String()
print "UsableHash => "; usableHash
Our system http://www.rokumanager.com
0 Kudos
hugetv
Level 7

Re: Helps to create code

alguien tendría una idea
Our system http://www.rokumanager.com
0 Kudos