Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
hugetv
Visitor

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 2
hugetv
Visitor

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
Visitor

Re: Helps to create code

alguien tendría una idea
Our system http://www.rokumanager.com
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.