Skip to content

Commit 8203bd0

Browse files
committed
Added comments to hashGen class
1 parent de4f189 commit 8203bd0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/com/redomar/game/lib/HashGen.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,18 @@ public class HashGen {
88
private boolean prefix;
99
private int hexLength;
1010

11+
/**
12+
* Use for generating a hex Hash. Requires two parameters;
13+
* @param showPrefix to show 0x prefix.
14+
* @param length Length of hash.
15+
*/
1116
public HashGen(boolean showPrefix, int length){
1217
this.prefix = showPrefix;
1318
this.hexLength = length;
1419
init();
1520
}
1621

22+
//Remove null char or prepend 0x
1723
private void init(){
1824
if(prefix){
1925
hexHash = "0x";
@@ -22,6 +28,10 @@ private void init(){
2228
}
2329
}
2430

31+
/**
32+
* Retrieve hash
33+
* @return String containing hash
34+
*/
2535
public String getHash(){
2636
setHash(hexLength);
2737
return hexHash;

0 commit comments

Comments
 (0)