Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * Wachtwoord dingus
- * door Thumb
- * $_GET['w'] staat voor het wachtwoord.
- * $_GET['l'] staat voor de gewenste lengte
- */
- if(!empty($_GET['l']) && is_numeric($_GET['l']) && !empty($_GET['w']))
- {
- if($_GET['l'] < strlen(hash('sha512', $_GET['w'])))
- {
- substr(hash('sha512', $_GET['w']), 0, $_GET['l']);
- }
- else {
- echo '$_GET[\'l\'] kan niet groter zijn dan ' . strlen(hash('sha512', $_GET['w'])) . ' met dit wachtwoord';
- }
- }
- else {
- echo '$_GET[\'w\'] of $_GET[\'l\'] heeft een foutieve invoer ($_GET[\'l\'] moet numeriek zijn)';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement