/magstudentportal/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/magstudentportal/trunk
15.1.7 by Gustav Hartvigsson
* added a few things that will help with development
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];
15.2.2 by Gustav Hartvigsson
* Added JUnit and javax.faces dependancies to the pom.xml.
18
    
15.1.7 by Gustav Hartvigsson
* added a few things that will help with development
19
    int b = t.getBytes()[a%t.length()];
20
    
15.2.2 by Gustav Hartvigsson
* Added JUnit and javax.faces dependancies to the pom.xml.
21
    
15.1.8 by Gustav Hartvigsson
* humm...
22
    
15.1.7 by Gustav Hartvigsson
* added a few things that will help with development
23
    
24
    return null;
25
  }
26
  
27
  /**
28
   * Hash a text with a salt.
29
   * 
30
   * @param t
31
   * @return
32
   */
33
  static public String
34
  hash_func (String t) {
35
    return real_hash_func(t, common.Config.PW_SALT);
36
  }
37
  
38
  
39
}