Skip to content
This repository has been archived by the owner on Apr 15, 2021. It is now read-only.

Commit

Permalink
Added BCryptEncoderGeneric sample
Browse files Browse the repository at this point in the history
  • Loading branch information
SheilaMaeTabligan committed Jun 14, 2019
1 parent f0d63ca commit 7d89388
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/sling/bcryptsample/MainApp.sling
@@ -0,0 +1,12 @@
class:

func main
{
var bcrypt = BCryptEncoder.create()
var salt = bcrypt.generateSalt(12)
PRINT "Salt : " .. salt
var hash = bcrypt.hashPassword("Super@dm1n", salt)
PRINT "Hash Password : " .. hash
var cp = bcrypt.checkPassword("Super@dm1n", hash)
PRINT "Password is matched? : " .. String.asString(cp)
}
25 changes: 25 additions & 0 deletions src/sling/bcryptsample/project.pling
@@ -0,0 +1,25 @@

/*
* This file is part of Eqela Samples
* Copyright (c) 2016-2018 Job and Esther Technologies Oy
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

preFilters += "@cape"

0 comments on commit 7d89388

Please sign in to comment.