/magstudentportal/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/magstudentportal/trunk

« back to all changes in this revision

Viewing changes to src/main/java/common/Utils.java

  • Committer: Gustav Hartvigsson
  • Date: 2017-08-18 12:05:06 UTC
  • mto: (15.1.9 magstudentportal-more-db)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: gustav.hartvigsson@gmail.com-20170818120506-qg1vf885gc5x2e17
* added a few things that will help with development

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package common;
 
2
 
 
3
public class
 
4
Utils {
 
5
  private Utils () {};
 
6
  
 
7
  /**
 
8
   * A hash function that salts the password
 
9
   * in a way that is pseudo dynamic.
 
10
   * 
 
11
   * @param t the text to salt
 
12
   * @param s the salt
 
13
   * @return
 
14
   */
 
15
  static public String
 
16
  real_hash_func (String t, String s) {
 
17
    int a = t.getBytes()[0];
 
18
    int b = t.getBytes()[a%t.length()];
 
19
    
 
20
    
 
21
    return null;
 
22
  }
 
23
  
 
24
  /**
 
25
   * Hash a text with a salt.
 
26
   * 
 
27
   * @param t
 
28
   * @return
 
29
   */
 
30
  static public String
 
31
  hash_func (String t) {
 
32
    return real_hash_func(t, common.Config.PW_SALT);
 
33
  }
 
34
  
 
35
  
 
36
}