GNU Smalltalk MD5 usage:
$ echo -n "foo" | md5
acbd18db4cc2f85cedef654fccc4a4d8
$ gst
st> PackageLoader fileInPackage: 'MD5'!
Loading package MD5
PackageLoader
st> MD5 hexDigestOf: 'foo'!
'acbd18db4cc2f85cedef654fccc4a4d8'
Generate a random salt?
st> Random between: 0 and: 35!
Intervals:
d := ((48 to: 57),(97 to:122))
st> ((48 to: 57),(97 to: 122)) do: [:x | (Character value: x) print]!
$0$1$2$3$4$5$6$7$8$9$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o$p$q$r$s$t$u$v$w$x$y$zArray new: 36 "<-0x4c59a328>"
st> Smalltalk at: #i put: ((48 to: 57),(97 to: 122))!
Array new: 36 "<-0x4c597200>"
st> i size!
36
| d i a l s |
i := 20.
d := '0123456789abcdefghijklmnopqrstuvwxyz'.
l := d size.
a := Array new: i.
1 to: i do: [ :x |
a at: x put: (d at: (Random between: 1 and: l))
].
s := String fromString: a.
s printNl!
| d i l s |
i := 20.
d := '0123456789abcdefghijklmnopqrstuvwxyz'.
l := d size.
s := String new: i.
1 to: i do: [ :x |
s at: x put: (d at: (Random between: 1 and: l))
].
s printNl!
sam@sol:~/tmp/smalltalk/flaw$ gst test.st
'w3ts9z4z25ce4iagvdd1'
sam@sol:~/tmp/smalltalk/flaw$ gst test.st
'37gct8mj6a06xzplre4s'
someone asked me:
what piques your interest in this world & in CS at large? i would like to hear some of your background.
hmm...
i'll start with the easy part of background:
- grew up on a small 150-years-old family farm in family of 4 kids, son of a chemistry teacher turned farmer and a math teather turned farmer's wife and mom
- went to purdue and studied cs
- work in software
- 29, married, one son
the next easiest is interests in CS:
- programming languages
- testing methodologies
- virtual machines (particularly userland concurrency models)
interests in this world is a quite difficult and deep question, i will take a shot at it:
- environment issues, right now focusing mainly on alternative energy (solar, wind, tide), water conservation, and biofuels (biodiesel particularly)
- astronomy, if i had a "pie in the sky" selfish wish in life it would be to walk on the moon or at least make it to space
- philosophy, mainly "what is truth and what does it mean to know it" and wondering if there is any meaning or purpose to the universe or any other experience at all
- political methods, election methods like condorcet, government structures like representative democracy vs. proportional representation, etc.
a lot of the time i wish i could opt out of the working world of technology and cars and just have a small garden and some chickens and be with my family under the blue sky. and be outside the range of light pollution! ;]
thanks for saying hello.
changed October 10, 2007