public String hashSystemEnv ( ) { List < String > system = new ArrayList < String > ( ) ; for ( Entry < Object , Object > el : System . getProperties ( ) . entrySet ( ) ) { system . add ( el . getKey ( ) + " " + el . getValue ( ) ) ; } Map < String , String > env = System . getenv ( ) ; for ( Entry < String , String > el : env . entrySet ( ) ) { system . add ( el . getKey ( ) + " " + el . getValue ( ) ) ; } Collections . sort ( system ) ; ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; try { DataOutputStream dos = new DataOutputStream ( baos ) ; for ( String s : system ) { dos . write ( s . getBytes ( ) ) ; } } catch ( IOException ex ) { // never } return hashByteArray ( baos . toByteArray ( ) ) ; }
Hashes system environment .