Your Digital Media Has Never Looked So Good

 
bmn
Topic Author
Posts: 78
Joined: Sun Aug 08, 2010 9:35 am

MD5 help

Mon Dec 26, 2011 6:09 am

Hi, i found an md5 function in the brightscript documentation, but it looks like it is not working

any ideas?
 
RokuLyndon

Re: MD5 help

Tue Dec 27, 2011 2:56 pm

I'm going to need more details than that.
 
bmn
Topic Author
Posts: 78
Joined: Sun Aug 08, 2010 9:35 am

Re: MD5 help

Wed Dec 28, 2011 4:40 am

Well i needed to convert a string to an MD5 hash, and found this in the documentation:

ifStringOps
SetString(s As String, strlen As Integer) As Void
AppendString(s As String, strlen As Integeter) As void
Len() As Integer
GetEntityEncode() As String
Tokenize(delim as String) As Object
Trim() As String
MD5() As String

and this

Box(x as Dynamic) as Object
Box() will return an object version of an intrinsic type, or pass through an object if given
one. For example, in places where you want to use string object functions on a string,
you can:

str=” this is a string ”
print box(str).trim()
bo = box(“string”)
bo=box(bo) „ no change to bo
print bo.md5()

showing a clear reference to a md5 function that i assume should return an md5 hash of the string

am i corerct?

thanks!
 
bmn
Topic Author
Posts: 78
Joined: Sun Aug 08, 2010 9:35 am

Re: MD5 help

Wed Dec 28, 2011 10:23 am

i tried both:

string.md5() and MD5(string), none seem to work..
 
RokuLyndon

Re: MD5 help

Sun Jan 01, 2012 6:54 pm

Are you talking about the Roku documentation? I don't see any of this in the BrightSign documentation.
 
bmn
Topic Author
Posts: 78
Joined: Sun Aug 08, 2010 9:35 am

Re: MD5 help

Mon Jan 02, 2012 11:18 am

ive read about that here:

www.brightsign.biz/documents/HDCompactB ... Manual.pdf

either way, if theres no native md5 encoding support, any other solution??

thanks!
 
RokuLyndon

Re: MD5 help

Mon Jan 02, 2012 8:39 pm

ok, so where's the actual code that you tried to use? What firmware are you running?
 
bmn
Topic Author
Posts: 78
Joined: Sun Aug 08, 2010 9:35 am

Re: MD5 help

Tue Jan 03, 2012 5:55 am

im running software version 4.2 build 1006
 
bmn
Topic Author
Posts: 78
Joined: Sun Aug 08, 2010 9:35 am

Re: MD5 help

Tue Jan 03, 2012 5:57 am

i tried the same example the documentation has... and its giving error..
 
bmn
Topic Author
Posts: 78
Joined: Sun Aug 08, 2010 9:35 am

Re: MD5 help

Tue Jan 10, 2012 11:42 am

found by chance the solution:

ba1 = CreateObject("roByteArray")
ba2 = CreateObject("roByteArray")
ba2.FromAsciiString(values)
digest = CreateObject("roEVPDigest")
digest.setup("md5")
digest.Update(ba1)
digest.Update(ba2)
result = digest.Final()
print result

Who is online

Users browsing this forum: No registered users and 3 guests