If you have purified solutions of vitamin B12 you can measure its absorbance using a spectrophotometer. If you have only extracts containing B12 and no advanced equipment such as HPLC or mass spectrometer, then you might be able to use a bioassay. This would consist of a strain of bacteria that were auxotrophic for B12 due to a metabolic defect in biosynthesis but contain the genes for B12 uptake. The growth rate of the bacteria would depend upon the external B12 concentration. The assay would be calibrated with purified B12.