Open a new Photoshop file with 250x200 px dimensions. Make the colour of background white and the color of filling black with SHIFT-(D). Draw a line at the 1 px thickness like beside.
When The Layer belong to the line is selected, click on Fitler > Noise > Add Noise.
Just after that, click on CTRL+(T) or Edit > Transform > Scale. Keep it on the point indicated with blue arrow beside and drag it above with the aid of SHIFT button until you get the Picture beside.
Step4 Select an area how much you want to cut with Rectangular Morquee Tool and erase this part with DELETE button .Write what you would like . The result should be like beside. There is no need to struggle too much. If you would like you can use writing fonts as ready-made barcode by searching in google.com as Barcode Fonts.