-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
445 additions
and
111 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,63 @@ | ||
import React, { Component } from 'react'; | ||
import logo from './logo.svg'; | ||
import React, {Component} from 'react'; | ||
import './App.css'; | ||
import Input from "./components/input"; | ||
import Md5Hash from './components/cryptomd5'; | ||
import SpecialHash from './components/specialhash'; | ||
import * as crypto from 'crypto' | ||
import CopyPasteInput from "./components/copy-paste-input"; | ||
|
||
class App extends Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { value: 'my amazing easy password', toggle: false }; | ||
this.change = this.change.bind(this); | ||
this.toggle = this.toggle.bind(this); | ||
} | ||
change(event) { | ||
// this.setState({value: event.target.value}); | ||
this.setState({ value: event.target.value }); | ||
} | ||
toggle() { | ||
console.log((!this.state.toggle)); | ||
this.setState({ toggle: !this.state.toggle }); | ||
console.log(this.state.toggle); | ||
} | ||
render() { | ||
return ( | ||
<div className="container"> | ||
<div className='row'> | ||
<div className='col-12'> | ||
{Input(this.change)} | ||
</div> | ||
<div className='col-12'> | ||
<button className="btn btn-info btn-block" onClick={() => this.toggle()}> | ||
{this.state.toggle? this.state.value : 'voir'} | ||
</button> | ||
<hr /> | ||
</div> | ||
<div className='col-12'> | ||
{Md5Hash(this.state.value)} | ||
<hr /> | ||
constructor(props) { | ||
super(props); | ||
this.state = {value: 'my amazing easy password', toggle: false}; | ||
this.change = this.change.bind(this); | ||
this.toggle = this.toggle.bind(this); | ||
} | ||
|
||
</div> | ||
<div className='col-12'> | ||
{SpecialHash(this.state.value)} | ||
<hr /> | ||
change(event) { | ||
// this.setState({value: event.target.value}); | ||
this.setState({value: event.target.value}); | ||
} | ||
|
||
|
||
toggle() { | ||
this.setState({toggle: !this.state.toggle}); | ||
} | ||
|
||
md5(key) { | ||
return crypto.createHash('md5').update(key).digest("hex"); | ||
} | ||
|
||
base64(key) { | ||
return btoa(key); | ||
} | ||
|
||
render() { | ||
return ( | ||
<div className="container"> | ||
<div className='row'> | ||
<div className='col-12'> | ||
{Input(this.change)} | ||
</div> | ||
<div className='col-12'> | ||
<button className="btn btn-info btn-block" onClick={() => this.toggle()}> | ||
{this.state.toggle ? this.state.value : 'voir'} | ||
</button> | ||
<hr/> | ||
</div> | ||
<div className='col-12'> | ||
<h3>MD5</h3> | ||
{CopyPasteInput(this.md5(this.state.value))} | ||
<hr/> | ||
|
||
</div> | ||
<div className='col-12'> | ||
<h3>MD5=>Base64</h3> | ||
{CopyPasteInput(this.base64(this.md5(this.state.value)))} | ||
<hr/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
); | ||
} | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from 'react' | ||
import * as crypto from 'crypto' | ||
|
||
const CopyPasteInput = (str) => { | ||
const guid = () => { | ||
function s4() { | ||
return Math.floor((1 + Math.random()) * 0x10000) | ||
.toString(16) | ||
.substring(1); | ||
} | ||
|
||
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + | ||
s4() + '-' + s4() + s4() + s4(); | ||
} | ||
const copyPast = () => { | ||
var copyText = document.getElementById(idKey); | ||
copyText.select(); | ||
document.execCommand("Copy"); | ||
}; | ||
const idKey = guid(); | ||
return ( | ||
<div className="row"> | ||
<div className="col-12"> | ||
<div className="input-group mb-3"> | ||
<div className="input-group-prepend"> | ||
<button onClick={() => copyPast()} className="btn btn-lg btn-primary">COPY</button> | ||
</div> | ||
<input readOnly | ||
type="text" value={str} className="form-control" id={idKey} placeholder="Your Next-password" /> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
) | ||
} | ||
|
||
export default CopyPasteInput |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.