Skip to content

Commit b545550

Browse files
committed
Initial commit
0 parents  commit b545550

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

‎pom.xml‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>ru.yandex.practicum</groupId>
8+
<artifactId>base64-encoder</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
11+
<properties>
12+
<maven.compiler.source>21</maven.compiler.source>
13+
<maven.compiler.target>21</maven.compiler.target>
14+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15+
</properties>
16+
17+
<build>
18+
<plugins>
19+
<plugin>
20+
<groupId>org.apache.maven.plugins</groupId>
21+
<artifactId>maven-compiler-plugin</artifactId>
22+
<version>3.11.0</version>
23+
</plugin>
24+
</plugins>
25+
</build>
26+
27+
</project>

‎src/main/java/Encoder.java‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import java.util.Scanner;
2+
3+
public class Encoder {
4+
5+
public static void main(String[] args) {
6+
final Scanner scanner = new Scanner(System.in);
7+
System.out.print("Введите строку => ");
8+
final String input = scanner.nextLine();
9+
final String encoded = org.apache.commons.codec.binary.Base64.encodeBase64String(
10+
input.getBytes()
11+
);
12+
System.out.println(encoded);
13+
}
14+
}

0 commit comments

Comments
 (0)