This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
built_in:crypt [2015/09/21 21:42] administrator old revision restored (2015/03/20 14:12) |
built_in:crypt [2017/07/01 06:27] administrator old revision restored (2015/10/03 17:07) |
||
---|---|---|---|
Line 20: | Line 20: | ||
If it does not match, the app does not continue. | If it does not match, the app does not continue. | ||
<code JavaScript md5.js> | <code JavaScript md5.js> | ||
- | |||
// | // | ||
function OnStart() | function OnStart() | ||
{ | { | ||
- | var crypt = app.CreateCrypt(); | ||
var chk = app.LoadText(" | var chk = app.LoadText(" | ||
- | var pass = prompt(""," | + | var pass = prompt(" |
if (pass==null) app.Exit(); | if (pass==null) app.Exit(); | ||
+ | var crypt = app.CreateCrypt(); | ||
var md5 = crypt.Hash( pass, | var md5 = crypt.Hash( pass, | ||
+ | md5 = md5.substr(0, | ||
if (chk == " | if (chk == " | ||
- | else if(chk != md5) app.Exit(); | + | else if(chk != md5) |
+ | { | ||
+ | app.ShowPopup(" | ||
+ | app.Exit(); | ||
+ | } | ||
+ | |||
// | // | ||
lay = app.CreateLayout( " | lay = app.CreateLayout( " | ||
+ | |||
// | // | ||
- | txt = app.CreateText( " | + | txt = app.CreateText( " |
txt.SetTextSize( 32 ); | txt.SetTextSize( 32 ); | ||
lay.AddChild( txt ); | lay.AddChild( txt ); |