Skip to content

Commit

Permalink
Merge pull request #26 from filip26/feat/decoder
Browse files Browse the repository at this point in the history
0.0.1
  • Loading branch information
filip26 authored Nov 21, 2023
2 parents a65d667 + 86eb779 commit 537151a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>

<modelVersion>4.0.0</modelVersion>
<groupId>com.apicatalog</groupId>
<artifactId>copper-multibase</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1</version>
<packaging>jar</packaging>

<name>Copper Multibase</name>
Expand Down Expand Up @@ -58,7 +57,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<argLine>-Dfile.encoding=UTF-8</argLine>

<junit.version>5.10.1</junit.version>
</properties>

Expand Down
18 changes: 18 additions & 0 deletions src/main/java/com/apicatalog/multibase/Multibase.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.apicatalog.multibase;

import java.util.Objects;
import java.util.function.Function;

import com.apicatalog.base.Base58;
Expand Down Expand Up @@ -90,4 +91,21 @@ public String encode(byte[] data) {

return prefix + encode.apply(data);
}

@Override
public int hashCode() {
return Objects.hash(prefix);
}

@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Multibase other = (Multibase) obj;
return prefix == other.prefix;
}
}

0 comments on commit 537151a

Please sign in to comment.