Ultra Geile Studenten Benutzer Oberfläche (UGSBO)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
834 B

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. package ugsbo.com.buchhaltung;
  2. import java.security.MessageDigest;
  3. public class Block {
  4. int data;
  5. int kontostand;
  6. Block vorher;
  7. String ownHash;
  8. String previousHash;
  9. public Block(int data, Block vorher, String previousHash, int konto) {
  10. this.data = data;
  11. ownHash = createNewHash();
  12. kontostand = konto + this.data;
  13. this.vorher = vorher;
  14. this.previousHash = previousHash;
  15. }
  16. public Block(int data) {
  17. this.data = data;
  18. ownHash = createNewHash();
  19. kontostand = this.data;
  20. this.vorher = null;
  21. this.previousHash = null;
  22. }
  23. private String createNewHash() {
  24. return null;
  25. }
  26. public int getKontostand() {
  27. return kontostand;
  28. }
  29. public Block getVorher() {
  30. return vorher;
  31. }
  32. public String getHash() {
  33. return ownHash;
  34. }
  35. }