Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-14664] Added Ti.Utils module #176

Merged
merged 4 commits into from Sep 19, 2013

Conversation

pec1985
Copy link
Contributor

@pec1985 pec1985 commented Sep 19, 2013

Test case:

var win = Ti.UI.createWindow({
    layout: 'vertical'
});

function Button(_title, _callback) {
    var btn = Ti.UI.createButton({
        title: _title,
        top: 10
    });

    btn.addEventListener('click', _callback);
    return btn
}

win.add(Button('base64encode', base64encode));
win.add(Button('base64decode', base64decode));
win.add(Button('md5', md5));
win.add(Button('sha1', sha1));
win.add(Button('sha256', sha256));

win.open();

function base64encode() {
    var result = Ti.Utils.base64encode('Titanium Rocks!').text;
    Ti.API.info('base64encode');
    Ti.API.info(result);
}
function base64decode() {
    var result = Ti.Utils.base64decode('VGl0YW5pdW0gUm9ja3Mh').text;
    Ti.API.info('base64decode');
    Ti.API.info(result);
}
function md5() {
    var result = Ti.Utils.md5HexDigest('Titanium Rocks!');
    Ti.API.info('md5');
    Ti.API.info(result);
}
function sha1() {
    var result = Ti.Utils.sha1('Titanium Rocks!');
    Ti.API.info('sha1');
    Ti.API.info(result);
}
function sha256() {
    var result = Ti.Utils.sha256('Titanium Rocks!');
    Ti.API.info('sha256');
    Ti.API.info(result);
}

@mtnlife999
Copy link
Contributor

Ran test case and everything looks good.

mtnlife999 pushed a commit that referenced this pull request Sep 19, 2013
[TIMOB-14664] Added Ti.Utils module
@mtnlife999 mtnlife999 merged commit 0409aac into appcelerator-archive:master Sep 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants