File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments